﻿using System;
using System.Collections.Generic;
using System.Text;
using Vortex.Drawing;
using Vortex.Input;

namespace Vortex.SceneFramework {

	///<summary>Delegate type of mouse event caster</summary>
	public delegate void MouseGraphEventHandler(Node sender, MouseEventInfo args);

	///<summary>Mouse Event arguments</summary>
	public class MouseEventInfo : InputEventInfo {
		private Vector2 _location;
		private MouseButton _button;		
		private int _wheelDelta;

		/// <summary>
		/// Initializes a new instance of the <see cref="MouseEventInfo"/> class.
		/// </summary>
		/// <param name="eventTarget">The event target.</param>
		/// <param name="location">The location of event.</param>
		/// <param name="button">The event button.</param>
		/// <param name="modificationKeys">Modification keys.</param>
		public MouseEventInfo(Node eventTarget, Vector2 location, MouseButton button, int wheelDelta, KeyStates keyStates)
			: base(eventTarget, keyStates) {
			_location = location;
			_button = button;
			_wheelDelta = wheelDelta;
		}


		/// <summary>
		/// Gets the event location point in world coordinates.
		/// </summary>
		/// <value>The event location.</value>
		public Vector2 Location {
			get { return _location; }
		}

		/// <summary>
		/// Gets the X coordinate of event location.
		/// </summary>
		/// <value>The X event coordinate.</value>
		public float X {
			get { return _location.X; }
		}

		/// <summary>
		/// Gets the Y coordinate of event location.
		/// </summary>
		/// <value>The Y event coordinate.</value>
		public float Y {
			get { return _location.Y; }
		}

		/// <summary>
		/// Gets the wheel delta changed with this event.
		/// </summary>
		/// <value>The wheel delta.</value>
		public int WheelDelta {
			get { return _wheelDelta; }
		}

		/// <summary>
		/// Gets mouse button which raised this event
		/// </summary>
		/// <value>The mouse button code.</value>
		public MouseButton Button {
			get { return _button; }
		}

	}
}
